# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=enchant

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.6.0
pkgrel=1
pkgdesc="Enchanting Spell Checking Library (mingw-w64)"
arch=('any')
url="http://www.abisource.com/"
license=("LGPL-2.1+")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
depends=(${MINGW_PACKAGE_PREFIX}-gcc-libs
    ${MINGW_PACKAGE_PREFIX}-glib2
    ${MINGW_PACKAGE_PREFIX}-hunspell)
options=('!libtool' 'strip' '!makeflags')
source=("http://www.abisource.com/downloads/${_realname}/${pkgver}/${_realname}-${pkgver}.tar.gz")
md5sums=('de11011aff801dc61042828041fb59c7')

prepare() {
  cd "$srcdir/${_realname}-$pkgver"
}

build() {

  mkdir -p "${srcdir}/${_realname}-${pkgver}-build-${CARCH}"
  cd "${srcdir}/${_realname}-${pkgver}-build-${CARCH}"
  
  ${srcdir}/${_realname}-${pkgver}/configure \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --prefix=${MINGW_PREFIX} \
  --enable-ispell --enable-myspell --with-system-myspell \
  --disable-aspell --disable-voikko --disable-uspell \
  --disable-hspell --disable-zemberek
  
  make
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}-build-${CARCH}"
  make DESTDIR="${pkgdir}" install
}
